import request from '@u/request'
import { header } from '@/api/project-update/tempHeader'

// const gateway = '/project'
const gateway = '/project'
// const gateway = 'http://localhost:8080/city/local'

export function getAreaStorageList(params) {
  return request({
    url: `${gateway}/region/selectRegion`,
    method: 'post',
    data: params,
    headers: { ...header },
  })
}

export function getAreaStoragePassList(params) {
  return request({
    url: `${gateway}/region/selectPassRegion`,
    method: 'get',
    params,
    headers: { ...header },
  })
}

export function getAreaStorageDetail(pkid) {
  return request({
    url: `${gateway}/region/selectRegion/` + pkid,
    method: 'get',
    headers: { ...header },
  })
}

export function addAreaStorage(data, params = {}) {
  return request({
    url: `${gateway}/region/insertRegion`,
    method: 'post',
    data,
    params,
    headers: { ...header },
  })
}

// /region/updateRegion
export function updateAreaStorage(data, params = {}) {
  return request({
    url: `${gateway}/region/updateRegion`,
    method: 'put',
    data,
    params,
    headers: { ...header },
  })
}

export function deleteAreaStorage(pkid) {
  return request({
    url: `${gateway}/region/deleteRegion/` + pkid,
    method: 'delete',
    headers: { ...header },
  })
}
